// pages/me/commodity/commodity.js
const app = getApp()
import { userMyorder } from '../../../api/api.js';
import { tips } from '../../../utils/show.js';
import { formatDate } from '../../../utils/util.js'

Page({
  data: {
    height: app.globalData.height * 2 + 30,
    nvabarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '已兑换商品 ', //导航栏 中间的标题
      img: "../../image/back.png"
    },
    list:[],
    imgUrl: app.globalData.imgUrl
  },

  onLoad: function (options) {
    this.getMyorderList();
  },

  getMyorderList(){
    let data = {
      openid: app.globalData.openid,
    }
    app.showLoading();
    userMyorder(data).then(res => {
      app.hideLoading();
      if (res.code == 0) {
        let list = res.data;
        this.setData({
          list:list.data,
        });
      } else {
        tips("数据出错");
      }
    })
  }
})